﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            账号：<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="账号不能为admin" ControlToValidate="TextBox1" Display="Dynamic" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="内容为必填" ControlToValidate="TextBox1" Display="Dynamic"></asp:RequiredFieldValidator>
            <br/>
            密码：<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="内容为必填" ControlToValidate="TextBox2" Display="Dynamic"></asp:RequiredFieldValidator>
            <br/>
            确认密码：<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="内容为必填" ControlToValidate="TextBox3" Display="Dynamic"></asp:RequiredFieldValidator><asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="两次密码输入必须一致" ControlToCompare="TextBox2" ControlToValidate="TextBox3" Display="Dynamic"></asp:CompareValidator>
            <br/>
            年龄：<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox><asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="年龄超出界限" ControlToValidate="TextBox4" Display="Dynamic" MaximumValue="100" MinimumValue="0" Type="Integer"></asp:RangeValidator>
            <br/>
            出生日期：<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="格式必须为2000-01-01" ControlToValidate="TextBox5" ValidationExpression="\d{4}-\d{2}-\d{2}" Display="Dynamic"></asp:RegularExpressionValidator><asp:RangeValidator ID="RangeValidator2" runat="server" ErrorMessage="超出时间范围" ControlToValidate="TextBox5" Display="Dynamic" MinimumValue="1900-01-01" Type="Date"></asp:RangeValidator>
            <br/>
            毕业时间：<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox><asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="格式必须为2000-01-01" ControlToValidate="TextBox6" Display="Dynamic" ValidationExpression="\d{4}-\d{2}-\d{2}"></asp:RegularExpressionValidator><asp:CompareValidator ID="CompareValidator2" runat="server" ErrorMessage="毕业时间不能早于或等于出生时间" ControlToCompare="TextBox5" ControlToValidate="TextBox6" Display="Dynamic" Operator="GreaterThan"></asp:CompareValidator>
            <br/>
            邮箱：<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="TextBox7" ErrorMessage="格式不正确" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            <br/>
            <asp:Button ID="Button1" runat="server" Text="提交" OnClick="Button1_Click" />
            <br/>
            <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
            <br/>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
        </div>
    </form>
</body>
</html>
